#!/bin/bash
# directory need to monitor 
DIR=/root/php

# monitor $DIR  and do something (%w path  %f name)
inotifywait -rmq -e "create,modify" $DIR --format "%f" | while read FILE
do
  echo "something happened on path $FILE"
done
